<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    var ary = [{
      id: 1,
      name: '张三'
    }, {
      id: 2,
      name: '李四'
    }];
    let target = ary.find((item, index) => item.id == 2);
    console.log(target);	// {id: 2, name: "李四"}
  </script>
</body>
</html>